//
//  PassView.m
//  02-Lagou
//
//  Created by 韩旭 on 16/7/16.
//  Copyright © 2016年 基础. All rights reserved.
//

#import "PassView.h"

@interface PassView ()
@property (nonatomic, strong) UIButton *btnBack;
@property (nonatomic, strong) UILabel *LableBack;
@property (nonatomic, strong) UITextField *fieldPhone;
@property (nonatomic, strong) UITextField *fieldVerify;
@property (nonatomic, strong) UIButton *btnNext;
@property (nonatomic, strong) UIButton *btnFindPass;
@property (nonatomic, strong) UIButton *btnChilk;
@property (nonatomic, strong) UIView *viewLineUp;
@property (nonatomic, strong) UIView *viewDown;
@property (nonatomic, strong) UILabel *lableText;
@property (nonatomic, strong) UIButton *btnChilkHere;
@end

@implementation PassView

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self creatBtnBack];
//    [self creatLableBack];
    [self creatTextField];
    [self creatBtnNext];
}
- (void)creatBtnBack {
    
    self.btnBack = [UIButton buttonWithType:UIButtonTypeCustom];
    self.btnBack.frame = CGRectMake(0, 0, WIDETH * 0.2, HEIGHT * 0.05);
    self.btnBack.center = CGPointMake(WIDETH * 0.12, HEIGHT * 0.07);
    [self.btnBack setTitle:@"返回" forState:UIControlStateNormal];
    [self.btnBack setTitleColor:[UIColor colorWithRed:0.00 green:0.73 blue:0.55 alpha:1.00] forState:UIControlStateNormal];
    [self.btnBack setImage:[UIImage imageNamed:@"fanhui"] forState:UIControlStateNormal];
    self.btnBack.backgroundColor = [UIColor clearColor];
    [self.view addSubview:_btnBack];
    [self.btnBack addTarget:self action:@selector(btnWithBack:) forControlEvents:UIControlEventTouchUpInside];
}
- (void)creatLableBack {
    UILable_HX *lable_hx = [[UILable_HX alloc] init];
    self.LableBack = [lable_hx packWithLableText:@"验证手机" Frame:CGRectMake(0, 0, WIDETH * 0.2, HEIGHT * 0.045) Color:[UIColor clearColor] target:self Action:nil];
    _LableBack.center = CGPointMake(WIDETH / 2, HEIGHT * 0.1225);
    self.LableBack.textAlignment = 1;
    [self.view addSubview:_LableBack];
}

- (void)creatTextField {
//    创建输入手机号
    self.fieldPhone = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, WIDETH * 0.9, HEIGHT * 0.05)];
    self.fieldPhone.center = CGPointMake(WIDETH / 2, HEIGHT * 0.2);
    self.fieldPhone.backgroundColor = [UIColor clearColor];
    self.fieldPhone.placeholder = @" 手机号 (仅支持中国大陆号)";
    self.fieldPhone.leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.fieldPhone.frame.size.height, self.fieldPhone.frame.size.height)];
    UIImageView *imagePhoto = [UIImageView packImageViewFrame:CGRectMake(10, 10, self.fieldPhone.leftView.frame.size.width - 20, self.fieldPhone.leftView.frame.size.height - 20) imagePhoto:[UIImage imageNamed:@"icon_password"] colorBack:[UIColor clearColor] action:nil target:self];
    self.fieldPhone.leftViewMode = UITextFieldViewModeAlways;
    self.fieldPhone.leftView.backgroundColor = [UIColor clearColor];
    [self.fieldPhone.leftView addSubview:imagePhoto];
    [self.view addSubview:_fieldPhone];
    
//    行线
    self.viewLineUp = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.fieldPhone.frame.size.width, 2)];
    self.viewLineUp.backgroundColor = [UIColor colorWithRed:0.67 green:0.67 blue:0.67 alpha:1.00];
    self.viewLineUp.center = CGPointMake(WIDETH / 2, HEIGHT * 0.248);
    [self.view addSubview:_viewLineUp];
    
//    创建验证码。 。
    
    self.fieldVerify = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, self.fieldPhone.frame.size.width, self.fieldPhone.frame.size.height)];
    self.fieldVerify.backgroundColor = [UIColor clearColor];
    self.fieldVerify.center = CGPointMake(self.fieldPhone.center.x, HEIGHT * 0.28);
    self.fieldVerify.leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.fieldPhone.leftView.frame.size.width, self.fieldPhone.leftView.frame.size.height)];
    self.fieldVerify.placeholder = @" 验证码";
    UIImageView *imageVerify = [[UIImageView alloc] initWithFrame:CGRectMake(imagePhoto.frame.origin.x, imagePhoto.frame.origin.y, imagePhoto.frame.size.width, imagePhoto.frame.size.height)];
    imageVerify.image = [UIImage imageNamed:@"user_login_logo_code"];
//    验证码左视图
    self.fieldVerify.leftViewMode = UITextFieldViewModeAlways;
    self.fieldVerify.leftView.backgroundColor = [UIColor clearColor];
    [self.fieldVerify.leftView addSubview:imageVerify];
//    创建下行线
    self.viewDown = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.fieldVerify.frame.size.width, 3)];
    _viewDown.center = CGPointMake(WIDETH / 2, HEIGHT * 0.32);
    self.viewDown.backgroundColor = [UIColor colorWithRed:0.67 green:0.67 blue:0.67 alpha:1.00];
    [self.view addSubview:_viewDown];
    
//    验证码右视图
    self.fieldVerify.rightView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, WIDETH * 0.25, self.fieldVerify.leftView.frame.size.height)];
    self.fieldVerify.rightViewMode = UITextFieldViewModeAlways;
    self.fieldVerify.rightView.backgroundColor = [UIColor clearColor];
    [self.view addSubview:_fieldVerify];
    
//    创建获取验证码按钮
    UIButton *btnVerify = [UIButton buttonWithType:UIButtonTypeCustom];
    btnVerify.frame = CGRectMake(0, 0, self.fieldVerify.rightView.frame.size.width, self.fieldVerify.rightView.frame.size.height);
    [btnVerify setTitle:@"获取验证码" forState:UIControlStateNormal];
    [btnVerify setTitleColor:[UIColor colorWithRed:0.00 green:0.73 blue:0.55 alpha:1.00] forState:UIControlStateNormal];
    [self.fieldVerify.rightView addSubview:btnVerify];
}
- (void)creatBtnNext {
    self.btnNext = [UIButton buttonWithType:UIButtonTypeCustom];
    _btnNext.frame = CGRectMake(0, 0, WIDETH * 0.9, HEIGHT * 0.07);
    _btnNext.backgroundColor = [UIColor colorWithRed:0.00 green:0.73 blue:0.55 alpha:1.00];
    _btnNext.center = CGPointMake(WIDETH / 2, HEIGHT * 0.4);
    [_btnNext setTitle:@"下一步" forState:UIControlStateNormal];
    [_btnNext setTitleColor:[UIColor colorWithRed:0.00 green:0.80 blue:0.67 alpha:1.00] forState:UIControlStateNormal];
    [self.view addSubview:_btnNext];
//    邮箱用户找回密码, 请点击这里
    self.lableText = [[UILabel alloc] initWithFrame:CGRectMake(self.btnNext.frame.origin.x, HEIGHT * 0.45, WIDETH * 0.4, HEIGHT * 0.025)];
     _lableText.backgroundColor = [UIColor clearColor];
    _lableText.text = @"邮箱用户找回密码, 请";
    _lableText.textColor = [UIColor colorWithRed:0.67 green:0.67 blue:0.67 alpha:1.00];
    self.btnChilkHere = [[UIButton alloc] initWithFrame:CGRectMake(self.lableText.frame.origin.x + self.lableText.frame.size.width, self.lableText.frame.origin.y, WIDETH * 0.2, self.lableText.frame.size.height)];
     _btnChilkHere.backgroundColor = [UIColor clearColor];
    [_btnChilkHere setTitle:@"点击这里" forState:UIControlStateNormal];
    [_btnChilkHere setTitleColor:[UIColor colorWithRed:0.00 green:0.80 blue:0.67 alpha:1.00] forState:UIControlStateNormal];
    [self.view addSubview:_btnChilkHere];
    [self.view addSubview:_lableText];
}
- (void)btnWithBack:(UIButton *)btn {
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
